/**
 * 暂时没有用...
 * 
 */
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { Route, Redirect } from 'react-router-dom'

class TraRoute extends Component {
    render() {
        let { menus, ...rest } = this.props

        console.log('TraRoute.path', rest.path)
        return (
            menus && menus.length ?
                <Route {...rest} /> : <Redirect to="/main/index" />
        )
    }
}

const mapStateToProps = (state) => ({
    menus: state.menus
})

const mapDispatchToProps = {

}

export default connect(mapStateToProps, mapDispatchToProps)(TraRoute)
